package com.hzncc.scaffold;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.SpringBootVersion;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.SpringVersion;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

/**
 * @Author: DrunkBear
 * @Date: 2022-04-26 16:22
 * @Description: null
 */

@MapperScan("com.hzncc.scaffold.mapper")
@EnableScheduling
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class})
//@SpringBootConfiguration
//@EnableAutoConfiguration
//@ComponentScan
public class ScaffoldApplication {
    public static void main(String[] args) {
        SpringApplication.run(ScaffoldApplication.class, args);
        System.out.println("-----------------▄██-█▄---------\n" +
                "-----------------███▄██▄--------\n" +
                "-----------------███████--------\n" +
                "-----------------▀███████-------\n" +
                "-------------------██████▄▄-----\n" +
                "-------------------█████████▄---\n" +
                "-------------------██████▄████--\n" +
                "-------▄███████████████████████-\n" +
                "-----▄███████████████████████▀--\n" +
                "---▄██████████████████████------\n" +
                "---███████████████████████------\n" +
                "---███████████████████████------\n" +
                "-▄▄██████████████████████▀------\n" +
                "-█████████████████▀█████--------\n" +
                "-▀██████████████▀▀-▀█████▄------\n" +
                "-------▀▀▀▀▀▀▀▀▀------▀▀▀▀------\n");


        String springVersion = SpringVersion.getVersion();
        String springBootVersion = SpringBootVersion.getVersion();
        System.out.println("Spring版本:"+springVersion+"\nSpringBoot版本:"+springBootVersion);

        }

    //解决上传文件接收为null的方法
    @Bean(name = "multipartResolver")
    public CommonsMultipartResolver multipartResolver() {
        CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
        return multipartResolver;

    }
}
